Fix some xarray fails, test others
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Tue, 9 Dec 2025 11:19:37 +0000 (11:19 +0000)
committerGraham Inggs <ginggs@debian.org>
Tue, 9 Dec 2025 11:19:37 +0000 (11:19 +0000)
Tests failing with newer xarray

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug: partly https://github.com/pydata/xarray/issues/9661
Bug-Debian: https://bugs.debian.org/1088988
Forwarded: no

Gbp-Pq: Name 1088988_xarray_pyreadstat_compat.patch

pandas/tests/generic/test_to_xarray.py

index e882a3b7115294fa839c12075ab11d6ff14bdfd5..0d5c0bec4a9b7fbc7eb29f4c948fc4544db7f1c0 100644 (file)
@@ -54,9 +54,10 @@ class TestDataFrameToXArray:
         # datetimes w/tz are preserved
         # column names are lost
         expected = df.copy()
-        expected["f"] = expected["f"].astype(
-            object if not using_infer_string else "str"
-        )
+        # breaks in xarray >= 2024.10.0(?)
+        # debug print
+        r0 = result.to_dataframe()
+        print("expected",expected, expected.index, expected.dtypes, "actual",result, r0, r0.index, r0.dtypes,sep='\n')
         expected.columns.name = None
         tm.assert_frame_equal(result.to_dataframe(), expected)